import request from '@/utils/request'

// 查询BOM列表
export function listBom(query) {
  return request({
    url: '/pm/bom/list',
    method: 'get',
    params: query
  })
}

// 查询BOM详细
export function getBom(bomId) {
  return request({
    url: '/pm/bom/' + bomId,
    method: 'get'
  })
}

// 新增BOM
export function addBom(data) {
  return request({
    url: '/pm/bom',
    method: 'post',
    data: data
  })
}

// 修改BOM
export function updateBom(data) {
  return request({
    url: '/pm/bom',
    method: 'put',
    data: data
  })
}

// 删除BOM
export function delBom(bomId) {
  return request({
    url: '/pm/bom/' + bomId,
    method: 'delete'
  })
}

// 产品不分页
export function listProduct(query) {
  return request({
    url: '/pm/plan/product/getlist',
    method: 'get',
    params: query
  })
}